package com.ruoyi.web.controller.admin;

import java.util.List;
import javax.servlet.http.HttpServletResponse;

import com.ruoyi.system.domain.HospitalSubscribeProject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.system.domain.HospitalSubscribeRefundRecord;
import com.ruoyi.system.service.IHospitalSubscribeRefundRecordService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;

/**
 * 订单退款记录Controller
 * 
 * @author ruoyi
 * @date 2025-04-30
 */
@RestController
@RequestMapping("/admin/record")
public class HospitalSubscribeRefundRecordAdminController extends BaseController
{
    @Autowired
    private IHospitalSubscribeRefundRecordService hospitalSubscribeRefundRecordService;

    /**
     * 查询订单退款记录列表
     * @response {@link HospitalSubscribeRefundRecord}
     */
    @GetMapping("/list")
    public TableDataInfo list(HospitalSubscribeRefundRecord hospitalSubscribeRefundRecord)
    {
        startPage();
        List<HospitalSubscribeRefundRecord> list = hospitalSubscribeRefundRecordService.selectHospitalSubscribeRefundRecordList(hospitalSubscribeRefundRecord);
        return getDataTable(list);
    }

    /**
     * 导出订单退款记录列表
     */
    @Log(title = "订单退款记录", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response, HospitalSubscribeRefundRecord hospitalSubscribeRefundRecord)
    {
        List<HospitalSubscribeRefundRecord> list = hospitalSubscribeRefundRecordService.selectHospitalSubscribeRefundRecordList(hospitalSubscribeRefundRecord);
        ExcelUtil<HospitalSubscribeRefundRecord> util = new ExcelUtil<HospitalSubscribeRefundRecord>(HospitalSubscribeRefundRecord.class);
        util.exportExcel(response, list, "订单退款记录数据");
    }

    /**
     * 获取订单退款记录详细信息
     * @response {@link HospitalSubscribeRefundRecord}
     */
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id)
    {
        return success(hospitalSubscribeRefundRecordService.selectHospitalSubscribeRefundRecordById(id));
    }

}
